# Update expense approval setting

Turns the expense approval setting for a project on or off.
If a `backfill_date` is specified, expenses until the specified date will be approved and the results of the
approval will be emailed to the authenticated user. Once the expenses have been approved, they cannot be unapproved.
This endpoint returns structured Workspace objects.
As with all Kantata OX API endpoints, the returned data will be referenced in sorted order in the `results` array
and will be indexed by ID in the `workspaces` top-level JSON key.
Please see our [Response Format](#section/Response-Format) section for more information.

Endpoint: PUT /workspaces/{id}/toggle_expense_approvals
Version: 1.0.0

## Path parameters:

  - `id` (integer, required)
    The ID of the Model.

## Query parameters:

  - `include` (string)
    Any of the below associations can be included in your request by providing the `include` param, e.g. `include=association1,association2`.
- `account_color` (AccountColor) - Retrieves the color of the workspace. The response will include `account_color_id`, which references the data in the `account_colors` top-level key.
- `account_insights_mappings` (AccountInsightsMapping) - Retrieves the Insights dynamic dashboards in the workspace. The response will include `account_insights_mapping_ids`, which references the data in the `account_insights_mappings` top-level key.
- `approver` (User) - Retrieves the first approver (as determined by user ID) on the workspace who is viewable to the current user. The response will include `approver_id`, which references the data in the `users` top-level key.
- `approvers` (User) - Retrieves all time approvers on the workspace who are viewable to the current user. The response will include `approver_ids`, which references the data in the `users` top-level key.
- `billing_milestones` (BillingMilestone) - Retrieves the billing milestones for the workspace. The response will include `billing_milestone_ids`, which references the data in the `billing_milestones` top-level key.
- `creator` (User) - Retrieves the user who created the project. The response will include `creator_id`, which references the data in the `users` top-level key. If the creator has left the project, you can use `primary_counterpart` to get the provider-side team lead.
- `current_status_report` (StatusReport) - Retrieves the most recent project status report from today. The response will include `current_status_report_id`, which references the data in the `status_reports` top-level key.
- `current_user_participation` (Participation) - Retrieves the workspace participation of the current user. The response will include `current_user_participation_ids`, which references the data in the `participations` top-level key.
- `custom_field_values` (CustomFieldValue) - Retrieves custom field values for the workspace. The response will include `custom_field_value_ids`, which references the data in the `custom_field_values` top-level key.
- `external_references` (ExternalReference) - Includes references to external integrations for this object.
- `financial_viewers` (User) - Retrieves the users on the project who have financial access. The response will include `financial_viewer_ids`, which references the data in the `users` top-level key.
- `next_uncompleted_milestone` (Story) - Retrieves the next project milestone that is not complete. The response will include `next_uncompleted_milestone_id`, which references the data in the `stories` top-level key.
- `participants` (User) - Retrieves users that are participating in the project. The response will include `participant_ids`, which references the data in the `users` top-level key.
- `participations` (Participation) - Retrieves the [participations](/tag/Participations) of each participant in the project. The response will include `participation_ids`, which references the data in the `participations` top-level key.
- `possible_approvers` (User) - Retrieves the users that can be made time approvers on the workspace. The response will include `possible_approver_ids`, which references the data in the `users` top-level key.
- `primary_counterpart` (User) - Retrieves the lead of the Clients team. The response will include `primary_counterpart_id`, which references the data in the `users` top-level key.
- `primary_maven` (User) - Retrieves the lead of the Providers team. The response will include `primary_maven_id`, which references the data in the `users` top-level key.
- `primary_workspace_group` (WorkspaceGroup) - Retrieves the primary group associated with the project. The response will include `primary_workspace_group_id`, which references the data in the `workspace_groups` top-level key.
- `status_reports` (StatusReport) - Retrieves the status reports for the workspace. The response will include `status_report_ids`, which references the data in the `status_reports` top-level key.
- `timesheet_submissions` (TimesheetSubmission) - Retrieves the list of all submitted timesheets which the user can approve on the project. The response will include `timesheet_submission_ids`, which references the data in the `timesheet_submissions` top-level key.
- `workspace_groups` (WorkspaceGroup) - Retrieves groups associated with the project that is visible to the current user. The response will include `workspace_group_ids`, which references the data in the `workspace_groups` top-level key.
- `workspace_resources` (WorkspaceResource) - Retrieves the named resources for the workspace. The response will include `workspace_resource_ids`, which references the data in the `workspace_resources` top-level key.
- `workspace_resources_with_unnamed` (WorkspaceResource) - Retrieves the named and unnamed resources for the workspace. The response will include `workspace_resources_with_unnamed_ids`, which references the data in the `workspace_resources` top-level key.

  - `optional_fields` (array)
    Allows you to request one or more optional fields as an array.

## Request fields (application/json):

  - `workspace` (object)

  - `workspace.enable` (boolean)
    Whether expense approvals should be enabled.

  - `workspace.backfill_date` (string)
    If `enable` is true, this is the date through which to approve existing expenses. The date must be in [ISO 8601](https://www.w3.org/TR/NOTE-datetime) format.

## Response 200:

  - `200` (unknown)
    Workspace has been updated.

## Response 200 fields (application/json):

  - `count` (integer)

  - `meta` (object)

  - `meta.count` (integer)

  - `meta.page_count` (integer)

  - `meta.page_number` (integer)

  - `meta.page_size` (integer)

  - `results` (array)

  - `results.key` (string)

  - `results.id` (string)

  - `workspaces` (object)

  - `external_references` (object)

  - `stories` (object)

  - `users` (object)

  - `participations` (object)

  - `timesheet_submissions` (object)

  - `workspace_groups` (object)

  - `custom_field_values` (object)

  - `workspace_resources` (object)

  - `status_reports` (object)

  - `account_colors` (object)

  - `account_insights_mappings` (object)

  - `billing_milestones` (object)

## Response 400:

  - `400` (unknown)
    Bad Request

## Response 400 fields (application/json):

  - `errors` (array)

  - `errors.type` (string)

  - `errors.message` (string)

## Response 401:

  - `401` (unknown)
    Unauthorized request

## Response 401 fields (application/json):

  - `errors` (array)

  - `errors.type` (string)

  - `errors.message` (string)

## Response 403:

  - `403` (unknown)
    Forbidden request

## Response 403 fields (application/json):

  - `errors` (array)

  - `errors.type` (string)

  - `errors.message` (string)

## Response 404:

  - `404` (unknown)
    Page Not Found

## Response 404 fields (application/json):

  - `errors` (array)

  - `errors.type` (string)

  - `errors.message` (string)

## Response 422:

  - `422` (unknown)
    Unprocessable Entity

## Response 422 fields (application/json):

  - `errors` (array)

  - `errors.type` (string)

  - `errors.message` (string)

## Response 503:

  - `503` (unknown)
    Service is unavailable

## Response 503 fields (application/json):

  - `errors` (array)

  - `errors.type` (string)

  - `errors.message` (string)

